{% extends 'base_main.html' %}
{% load static %}
{% block extcss %}
    {{ block.super }}
    <link rel="stylesheet" href="{% static 'app/cart/cart.css' %}">
{% endblock %}
{% block extjs %}
    <script type="text/javascript" src="{% static 'app/cart/cart.js' %}"></script>
{% endblock %}
{% block content %}
    <div id="cart">
        <h3>购物车</h3>
        <div class="full">
            <section class="clear">
                <ul>
                    <li>收货人：张三
                        <div><p><span>修改&gt;</span></p></div>
                    </li>
                    <li>电话号码：654564</li>
                    <li>收货地址：四川省节点撒旦教</li>
                </ul>
                <div class="bill">
                    <p>闪送超市</p>
                    <a href="#">凑单专区</a>
                    <p>满100减99</p>
                </div>
                <div class="delivery">
                    <span>收货时间：</span>
                    <span>一小时送达</span>
                    <a href="#">可送达&gt;</a>
                </div>
                <div class="delivery">
                    <span>备注:</span>
                    <input type="text" placeholder="有什么特殊需求要跟商家说的">
                </div>
                <menu>
                    <ul>
                        {% if carts %}
                            {% for cart in carts %}
                                <li class="menuList" cartid="{{ cart.id }}">
                                    <div class="confirm">
                                        <span class="is_choose" is_select="{{ cart.is_select }}">
                                            {% if cart.is_select %}
                                                <span>√</span>
                                            {% else %}
                                                <span></span>
                                            {% endif %}
                                        </span>
                                    </div>
                                    <a href="#">
                                        <img src="{{ cart.goods.productimg }}" alt="{{ cart.goods.productlongname }}">
                                        <p>{{ cart.goods.productlongname }}</p>
                                        <p>&nbsp;&nbsp;&nbsp;&nbsp;单价:&nbsp;&nbsp;&nbsp;{{ cart.goods.price }}元</p>
                                    </a>
                                    <section>
                                        <button class="subShopping">-</button>
                                        <span>{{ cart.c_num }}</span>
                                        <button class="addShopping">+</button>
                                    </section>
                                </li>
                            {% endfor %}
                            <li class="payTheBill">
                                <div class="confirm" id="all_select">
                                <span>
{#                                服务器返回一个数据，用来判断是否全部选中，如果全部选中，那么全选按钮要加上√#}
                                    {% if is_all_select %}
                                        <span>√</span>
                                    {% else %}
                                        <span></span>
                                    {% endif %}

                                </span>
                                </div>
                                <p>
                                    <span>全选</span>
                                    <span>总价:{{ money }}元</span>
                                </p>
                                <span id="genarate_order">下单</span>
                            </li>
                        {% else %}
                            <div class="delivery">
                                <span style="color: #ff0000;">购物车空空如也，快去选购商品吧~~</span>
                            </div>
                        {% endif %}
                    </ul>
                </menu>
            </section>
        </div>
    </div>
{% endblock %}